<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2016/11/7
  Time: 16:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/mb/jsp/common.jsp" %>
<%@ page import="com.wsu.search.tools.Tools" %>
<%@ page import="com.limao.servlet.WebFunction" %>
<%@ page import="com.limao.DBDataClass.CrowdUserAuthClass" %>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>寄售</title>

</head>
<body class="bcf" ontouchstart="">
<div class="detailTop pf w100 of">
    <div class="w100 of tc cf f18">
       	寄售
    </div>
</div>

<div id="listContainer" class="container db jz mgt45 w100">
  	 <div id="resText"></div><!--resText-->
</div>

<!--footer-->
	<footer id="footer" class="footerTab w100 of pf">
	 
	</footer>

<script>
	  $(window).on("load", function() {
				$("#footer").load("mb/footer.jsp", function() {
				  footerTab(3);
				});
	    })



    var htmlStr="";

  	$(document).ready(function(){
	
		getData();
	  
	});


//加载新数据
    function getData() {
        $.ajax({
            url: "PlugServlet",
            data: JSON.stringify({m:3340}),
            type: 'post',
            dataType: 'json',
            contentType: "application/json;charset=utf-8",
            beforeSend: function () {
                showProgressDg();
            },
            success: function (data) {
            	console.log(data);
                if (data.state == 1) {
					if(data.list==""||data.list==null){
					 	showToast("暂无数据..");
	                 	return false;
	                 }
                  	 showData(data.list);
                } else {
                    // 其他错误弹出提示
                    showToast(data.info);
                }
            },
            error: function (data) {
                showToast(data.info);
            },
            complete: function () {
                closeProgressDg();
            }
        });
    }
    
    
  function showData(list)
    {
    	var htmlStr="";
    	var vrgoodsname ="";
    	var price ="";
    	var usergoodsnum ="";
    	
    	$.each(list, function(index, obj) 
    	{
    		vrgoodsname =  obj.vrgoodsname;
    		price = obj.price;
    		usergoodsnum = obj.usergoodsnum;
    		
    		htmlStr +=
	    		   	'<a href="mb/jsp/saleDetail.jsp?vrgoodsid='+obj.vrgoodsid+'&topTittle='+encodeURI(encodeURI(vrgoodsname))+'&price='+price+'&usergoodsnum='+usergoodsnum+'&days='+obj.Tdays+'" class="db w100 b-b">'
				  		+'<section class="w95 jz pdt10 pdb10 flexBox">'
					  		+'<div>'
					  			+'<h4 class="c3 f16">'+vrgoodsname+'</h4>'
					  			+'<div class="df c6 f14 lh2">'
					  				+'<p>参考价(元/瓶)：'+price+'</p>'
					  				+'<p>总瓶数：'+usergoodsnum+'</p>'
					  			+'</div>'
					  		+'</div>'
					  		+'<img src="mb/images/img10.png" alt="" class="db wauto rotate-90" style="height:12px;align-self:end;">'
				  		+'</section>'
				  	+'</a>'; 
    		
    	});
    	
    	 $("#listContainer").html(htmlStr);
    }

</script>

</body>
</html>
